import http from '@/utils/http.js'
// 登录
export const loginApi = (params) => {
	return http('login/login', params)
}
// 退出登录
export const logoutApi = (params) => {
	return http('login/logout', params)
}
// 首页
export const homeApi = (params) => {
	return http('index/index', params, true, 'GET')
}
// 编辑个人资料
export const editUserInfoApi = (params) => {
	return http('my/updateInfo', params)
}
// 修改密码
export const editPwdApi = (params) => {
	return http('login/forgotPassword', params)
}
// 意见反馈
export const feedbackApi = (params) => {
	return http('my/feedback', params)
}

// 订单列表
export const orderListApi = (path,params) => {
	return http(path, params, true, 'GET')
}
// 订单详情
export const orderDetailApi = (path, params) => {
	return http(path, params, true, 'GET')
}
// 获取物流列表
export const expressListApi = (params) => {
	return http('supply/getwuliu', params, true, 'GET')
}

// 供应商订单 ------ start ------
	// 是否确认订单
	export const confirmOrderApi = (params) => {
		return http('supply/verify', params)
	}
	// 获取订单统计
	export const orderStatisticsApi = (params) => {
		return http('statistics/supplyindex', params, true, 'GET')
	}
	// 全部发货：supply/allverify; 分批发货：'supply/noallverify'
	export const shippedApi = (path, params) => {
		return http(path, params)
	}
	// 分批发货
	export const partShippedGetApi = (params) => {
		return http('supply/noallverify', params, true, 'GET')
	}
// 供应商订单 ------ end ------
// 仓库订单 ------ start ------
	// 获取区域列表
	export const areaListApi = (params) => {
		return http('warea_house/getarea', params, true, 'GET')
	}
	// 接收
	export const receiveApi = (params) => {
		return http('warea_house/getshouhuo', params)
	}
	// 分配员工
	export const allocationApi = (params, type) => {
		return http('warea_house/editfenpei', params, true, type)
	}
	// 验收
	export const acceptanceApi = (params, type) => {
		return http('warea_house/check', params, true, type)
	}
	// 订单入库
	export const toWarehouseApi = (params) => {
		return http('warea_house/inhouse', params)
	}
	// 库存盘点
	export const inventoryCountApi = (params, type) => {
		return http('warea_house/pan', params, true, type)
	}
	// 库存预警列表
	export const warningListApi = (params) => {
		return http('warea_house/forewarninglists', params, true, 'GET')
	}
	// 新增库存预警（GET为获取sku详情）
	export const addWarningApi = (params, type) => {
		return http('warea_house/forewarning', params, true, type)
	}
	// 修改预警
	export const editWaringApi = (params) => {
		return http('warea_house/forewarningupdate', params)
	}
	// 待出库列表
	export const outHouseListApi = (params) => {
		return http('warea_house/outhouse', params, true, 'GET')
	}
	// 出库详情
	export const outHouseDetailApi = (params) => {
		return http('warea_house/outhousedetails', params, true, 'GET')
	}
	// 获取物流人员
	export const expressUserListApi = (params) => {
		return http('warea_house/getuser', params, true, 'GET')
	}
	// 出库
	export const outHouseApi = (params) => {
		return http('warea_house/chuku', params, true, 'GET')
	}
// 仓库订单 ------ end ------
// 仓库获取员工列表
export const emplopyeeListApi = (params) => {
	return http('index/getuser', params, true, 'GET')
}
// 修改员工状态
export const editStatusApi = (params) => {
	return http('employee/setuserstatus', params, true, 'GET')
}
// 设置员工今日工资
export const setSalaryApi = (params) => {
	return http('employee/setpay', params)
}
// 上传图片
export const uploadApi = async () => {
	const file = await uni.chooseImage({ count: 1 })
	const res = await uni.uploadFile({
		// 需要上传的地址
		url: import.meta.env.VITE_APP_BASE_URL + 'my/upload',
		filePath: file.tempFilePaths[0],
		fileType: 'image',
		name: 'image'
	});
	return JSON.parse(res.data)
}

